package com.ruoyi.order.service.impl;

import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.minio.util.SnowFlakeIdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.VerPointMapper;
import com.ruoyi.order.domain.VerPoint;
import com.ruoyi.order.service.IVerPointService;

/**
 * 订单项Service业务层处理
 *
 * @author ruoyi
 * @date 2025-08-21
 */
@Service
public class VerPointServiceImpl implements IVerPointService {
    @Autowired
    private VerPointMapper verPointMapper;

    private AtomicLong idGenerator = new AtomicLong();
    /**
     * 查询订单项
     *
     * @param id 订单项主键
     * @return 订单项
     */
    @Override
    public VerPoint selectVerPointById(Long id) {
        return verPointMapper.selectVerPointById(id);
    }

    /**
     * 查询订单项列表
     *
     * @param verPoint 订单项
     * @return 订单项
     */
    @Override
    public List<VerPoint> selectVerPointList(VerPoint verPoint) {
        return verPointMapper.selectVerPointList(verPoint);
    }

    /**
     * 新增订单项
     *
     * @param verPoint 订单项
     * @return 结果
     */
    @Override
    public int insertVerPoint(VerPoint verPoint) {
        verPoint.setId(idGenerator.getAndIncrement());
        verPoint.setCreateTime(DateUtils.getNowDate());
        return verPointMapper.insertVerPoint(verPoint);
    }

    /**
     * 修改订单项
     *
     * @param verPoint 订单项
     * @return 结果
     */
    @Override
    public int updateVerPoint(VerPoint verPoint) {
        return verPointMapper.updateVerPoint(verPoint);
    }

    /**
     * 批量删除订单项
     *
     * @param ids 需要删除的订单项主键
     * @return 结果
     */
    @Override
    public int deleteVerPointByIds(Long[] ids) {
        return verPointMapper.deleteVerPointByIds(ids);
    }

    /**
     * 删除订单项信息
     *
     * @param id 订单项主键
     * @return 结果
     */
    @Override
    public int deleteVerPointById(Long id) {
        return verPointMapper.deleteVerPointById(id);
    }
}
